home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 March / MINDWARE_MAR_2001.iso / Software / developers / Readers / buildzone zapper / Zapper.exe / GUIDELET.ZAP < prev    next >
Encoding:
Extensible Markup Language  |  2000-09-26  |  1023 b   |  38 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE pack SYSTEM "zapper.dtd">
  3.  
  4. <pack version="3.0"
  5.     title="Server Pack"
  6.     url="http://server.zapper.com/services/Provide?name=guidelet">
  7.  
  8. <hier>
  9.   <glref label="IntelliZap"
  10.    url="IntelliZap"/>
  11. </hier>
  12.  
  13. <zaplet title="IntelliZap" url="IntelliZap" type="extended">
  14.   <desc>
  15.   Search the Web for %[[keyword]%] in the surrounding context.
  16.   </desc>
  17.   <script lang="javascript"><![CDATA[function zaplet(text,context,location)
  18. {
  19.    var req = new HttpRequest("http://alg.zapper.com/intellizap/intellizap.jsp");
  20.    req.setMethod("POST");
  21.    req.addParam("text=" + text);
  22.    req.addParam("context=" + context);
  23.    req.addParam("location="+ location);
  24.    req.addParam("engine=mixed");
  25.  
  26.     // finding possible empty context
  27.    var strContext = context;
  28.    var re = /[ \t\n]+/;
  29.    strContext = strContext.replace( re, "" );
  30.    if ( strContext.length == 0 ){
  31.        req.addParam( "zoom=1" );    
  32.    }
  33.    return req;
  34. }]]></script>
  35. </zaplet>
  36.  
  37. </pack>
  38.